import { IsNotEmpty, Length, IsString, IsNumber, IsOptional, Min, IsArray, ArrayMinSize, ArrayMaxSize, IsNumberString } from 'class-validator';
import PaginationDto from '../../dtos/pagination.dto';

export default class Dto {
    @Length(0, 100)
    @IsString()
    @IsOptional()
    name:string;

    @Min(0)
    @IsNumber({})
    @IsOptional()
    price:string;

    @Min(0)
    @IsNumber({})
    @IsOptional()
    service:string;

    @Min(0)
    @IsNumber({})
    @IsOptional()
    pay:string;

    @Min(0)
    @IsNumber({})
    @IsOptional()
    hourKwh:number;

    @ArrayMinSize(1)
    @IsArray()
    @IsOptional()
    rules:any[]
}

export class AddDto extends Dto {
    
}



export class UpdateDto extends Dto {

}

export class PageDto extends PaginationDto {
    @Length(0, 100)
    @IsString()
    @IsOptional()
    name:string;

    @IsNumberString()
    @IsOptional()
    type:number;
}